#ifndef OBJECT_H
#define OBJECT_H

// Libraries
#include <irrlicht.h>

// Namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

// Forward Declarations
class CGMap;

// Classes
class CGObject 
{
public:
	enum GOType 
	{
		GOT_NONE = 0,
		GOT_PLAYER,
		GOT_MONSTER,
		GOT_NPC
	};

	enum GODir
	{
		DIR_U = 0,
		DIR_RU,
		DIR_RD,
		DIR_D,
		DIR_LD,
		DIR_LU
	};

	virtual void Render(const CGMap *TMap) { }

	CGObject(GOType _type);
	virtual ~CGObject();

	virtual void Update(u32 _dt) { }

	GOType GetType() const { return m_Type; }

	void SetDeleted(bool TValue) { m_Deleted = TValue; }
	bool GetDeleted() const { return m_Deleted; }

	void SetDir(GODir _dir) { m_Direction = _dir; }
	GODir GetDir() const { return m_Direction; }

	void SetNetworkID(char TValue) { m_NetworkID = TValue; }
	char GetNetworkID() const { return m_NetworkID; }

	void SetPosition(const position2di &TPosition) { m_Position = TPosition; }
	const position2di &GetPosition() const { return m_Position; }

	int GetMapID() const;

	// Instances
	void SetMap(CGMap *TMap);
	CGMap *GetMap();

protected:
	// Properties
	GOType m_Type;

	// State
	bool m_Deleted;
	position2di m_Position;

	GODir m_Direction;

	// Networking
	char m_NetworkID;

	// Instances
	CGMap *m_Map;		
};

#endif
